﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Story.Framework.WinUI
{
    public class AppClient
    {
        public static IMainForm MainForm
        {
            get
            {
                return (IMainForm)AppDomain.CurrentDomain.GetData("MAINFORM");
            }
            set
            {
                AppDomain.CurrentDomain.SetData("MAINFORM", value);
            }
        }
        public static void SendMessageToPage(string title, string msg)
        {
            foreach (KeyValuePair<string,PageBase> p in AppClient.MainForm.Pages)
            {
                p.Value.SendMessageDo(title, msg);
            }
        }
        public static void SendMessageToDock(string title, string msg)
        {
            foreach (KeyValuePair<string,DockPanelBase> d in AppClient.MainForm.Docks)
            {
                d.Value.SendMsageDo(title, msg);
            }
        }
        public static DateTime ServerTime
        {
            get { return DateTime.Now; }
        }
    }
}
